<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;

/* @var $this yii\web\View */
/* @var $searchModel common\models\search\UserMess */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '用户中心';
$img=Yii::$app->request->baseUrl.'/img/demo.png';
?>
<style>
    .row{
        background-color: #fff;
    }
</style>
<div class="row">
    <div class="col-md-10" style="padding:30px 15px 0 15px">
<table class="table">
<tr>
    <td><h5>用户名</h5></td>
    <td><h5><?php echo $userMess->username;?>&#12288; <a  href="<?php echo Url::to(['usermess/update_self','uid'=>$userMess->uid])?>">修改资料</a></h5></td>
</tr>

<tr>
    <td><h5>头像</h5></td>
    <td> <img src="<?php
        $image='/img/demo.png';

        if(!empty($userMess->relationImg->img_small)) $image=$userMess->relationImg->img_small;
//        p($image);die;
        echo  Yii::$app->request->baseUrl.$image;?>" width="150px"></td>
</tr>

<tr class="hidden">
    <td><h5>性别</td>
    <td><h5><?php echo $userMess->sex=='0' ? "男" : "女";?></h5></td>
</tr>


<tr>
    <td><h5>微信号</h5></td>
    <td><h5><?php echo $userMess->wechat ? $userMess->wechat : "暂无";?></h5></td>
</tr>
    <tr>
        <td><h5>邮箱</h5></td>
        <td><h5><?php echo $userMess->email ? $userMess->email : "暂无";?></h5></td>
    </tr>

<tr  class="hidden">
    <td><h5>年龄</h5></td>
    <td><h5><?php echo $userMess->age ? $userMess->age : "暂无";?></h5></td>
</tr>

<tr>
    <td><h5>城市</h5></td>
    <td><h5><?php echo  $userMess->addressCity  ?  \common\models\AddressCity::find()->where(['code'=>$userMess->addressCity])->one()->name : "暂无";?></h5></td>
</tr>

<tr  class="hidden">
    <td><h5>详细地址</h5></td>
    <td><h5><?php echo $userMess->address ? $userMess->address : "暂无";?></h5></td>
</tr>

<tr>
    <td><h5>职业经历</h5></td>
    <td><?php
            if(!empty($userMess->experience)){
             $arr=explode('@',$userMess->experience);
                foreach($arr as $v){
                   echo "<h5>$v</h5>";
                }
            }else
            echo  "<h5>暂无</h5>";

            ?></td>
</tr>

<tr  class="hidden">
    <td><h5>教育经历</h5></td>
    <td><h5><?php echo $userMess->education ? $userMess->education : "暂无";?></h5></td>
</tr>
</table>

</div>
</div>
<div class="row">
    <div class="col-md-12">
        <a  class='btn btn-primary' href="<?php echo Url::to(['usermess/update_self','uid'=>$userMess->uid])?>">修改资料</a>
    </div>
</div>
<br>